package com.jin.webvideo.mapper;

import com.jin.webvideo.entity.Video;
import com.jin.webvideo.entity.VideoInfo;
import com.jin.webvideo.entity.VideoSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface VideoMapper {

    List<String> selectCover(String docid, String tvid, String platform);

    List<VideoSearch> selectSearchByName(String name, int start, int count);

    int selectSearchCountByName(String name);

    List<Video> search(String title, String[] tags, int start, int count, String platform);

    int searchCount(String title, String[] tags,String platform);

    Video findVideoByDocid(String docid, String platform);

    List<String> findVideosInList(@Param("videos") List<Video> videos);

    int insertVideo(@Param("videos") List<Video> videos);

    List<VideoInfo> findAfterVideoInfoByDocid(String docid, String platform, int ordin, int count);

    List<VideoInfo> findVideoInfoByDocid(String docid, String platform);

    VideoInfo findVideoInfoByVid(String docid, String vid, String platform);

    VideoInfo findVideoInfoByUrl(String url);

    VideoInfo findVideoInfoByUrlAndPlatform(String url, String platform);

    int insertVideoInfo(@Param("infos") List<VideoInfo> infos);

    List<Map<String,String>> userVideoHis(String account, int start, int count);

    int insertProgress(String account, String pkey, long time);

    int updateProgress(String account, String pkey, long time);

    Long getCurrentTime(String account, String pkey);

    List<String> findVidInEpList(String platform, String docid, List<VideoInfo> infos);

    Map<String, Integer> findSegInfo(String platform, String docid, String vid);
}
